-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TFC workspace pagination #1587
Conversation
88db6e0
to
f532f92
Compare
try { | ||
return this.getWorkspaces(); | ||
this.cache = [...this.cache, ...(await this.getWorkspaces())]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I switch between organizations, I get a Element with id '<long_id> is already registered
. I think we need to have the refresh call in the organization switcher somehow indicate we need to clear the cache?
I've seen this behavior in other extensions that attempt to implement a load more experience, so this is expected if frustrating.
The Gitlens extension has a 'Load All' button on the 'Load More' item, which would address the multiple waits for more. It would not handle paging through the massive list after clicking, but that is a problem endemic to treeviews not just us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me!
* Only refresh runs for workspace items * Introduce cache and loadmore item * Clear cache on refresh * Enable loading indicator on load more * Fix error on org change * Reset cache AND workspace count * Use next-page instead of total-count
* Only refresh runs for workspace items * Introduce cache and loadmore item * Clear cache on refresh * Enable loading indicator on load more * Fix error on org change * Reset cache AND workspace count * Use next-page instead of total-count
* Only refresh runs for workspace items * Introduce cache and loadmore item * Clear cache on refresh * Enable loading indicator on load more * Fix error on org change * Reset cache AND workspace count * Use next-page instead of total-count
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This PR adds a simple pagination to the workspaces view. We load the next page and append it to the tree view when a user clicks "load more".
Hitting refresh or using the project filter will reset the cache.
UX
I'd like to improve the UX here, but it's not possible to programatically update the scroll position or deselect an item. Also, the current solution is cumbersome for 500+ workspaces, where a user would have to hit "load more" at least 10 times to get to workspaces further down the list. A filter (e.g. by name) might improve this in the future.